import { getActivityList, getaDetail } from '@/api/activity'

export default {
  namespaced: true, // 封闭
  state: {},
  mutations: {},
  actions: {
    // 获取 活动列表
    async fetchActivityList(context, payload) {
      let { keyword, size, current } = payload
      try {
        const { data } = await getActivityList(keyword, size, current)
        return data
      } catch (err) {
        console.log(err)
      }
    },
    // 获取 活动列表 详情
    async fetchaDetail(context, payload) {
      let { businessId } = payload
      try {
        const { data } = await getaDetail(businessId)
        return data
      } catch (err) {
        console.log(err)
      }
    }
  }
}
